package com.live.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.four.common.utils.R;
import com.live.service.LiveService;
import com.live.vo.LiveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lky
 * @version 1.0
 * @date 2022/1/5 18:58
 */
@RestController
@RequestMapping("live")
public class LiveController {

    @Autowired
    private LiveService liveService;

    /**
     * 直播列表
     * @param page
     * @param pageSize
     * @return
     */
    @PostMapping("list")
    public R arrayList(
            @RequestParam(value = "page",defaultValue = "1") Integer page,
            @RequestParam(value = "pageSize",defaultValue = "3") Integer pageSize,
            @RequestParam(value = "status",defaultValue = "0") Integer status
    ){
        IPage<LiveVo> page1 = liveService.getList(page,pageSize,status);

        return R.ok().put("page",page1);
    }

}
